<script>
    var js_url = "<?php echo $base_url ?>";
    $(function() {
        //hiện thông báo:
        var msg = "<?php echo $msg; ?>";
        if (msg != "")
            alert("<?php echo $msg; ?>");

        if (msg == "Mã xác nhận không đúng.")
            $("#txt_capchar").focus();
    });
</script>
<script type="text/javascript" src="<?php echo $img_url; ?>style/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo $img_url; ?>style/js/FE/fe_adv.js"></script>
<!-- RaoVat: Dang tin -->
<div id="adv-title">
    <span class="title">Rao Vặt</span>
    <img src="<?php echo $img_url; ?>style/images/img28.gif">
    &nbsp;<span class="title">Đăng Tin</span>
</div>  
<div id="seperator"></div>
<!-- details: column -->
<div id="adv-body">
    <form name="frmAdv" id="frmAdv" method="POST" action="<?php echo $base_url; ?>rao-vat/dang-tin" enctype="multipart/form-data" onSubmit="return submitPost_jQuery();">
        <input type="hidden" name="isPost" value="1">    
        <ul class="ul_dangtin">
            <!-- row 1 -->
            <li class="left">
                <span class="text">Tiêu đề:</span>
                <span class="star">*</span>
            </li>
            <li class="right"><input type="text" id="txt_title" name="txt_title" class="txt_text1" value="<?php if (isset($title)) echo $title; ?>" maxlength="200"></li>
            <!-- row 2 -->
            <li class="left">
                <span class="text">Nội dung:</span>
                <span class="star">*</span>
            </li>
            <li class="right"><textarea cols="10" id="txt_desc" name="txt_desc" rows="8" class="txt_content"><?php if (isset($desc)) echo $desc; ?></textarea></li>        
            <!-- row 3 -->
            <li class="left">
                <span class="text">Phân loại:</span>
                <span class="star">*</span>
            </li>
            <li class="right">
                <select name="cbo_ADV_Cate" id="cbo_ADV_Cate" class="ADV_Cate">
                    <option class="ADV_Cate_item" value="">-- Chọn chuyên mục --</option>
                    <?php foreach ($aAdvCate as $key => $item): ?>
                        <option class="ADV_Cate_item" value="<?php echo $item->cate_id; ?>" <?php if (isset($adv_cate_id) && ($adv_cate_id == $item->cate_id)) echo "selected='selected'" ?>><?php echo $item->cate_name; ?></option>
                        <?php
                        $i++;
                    endforeach;
                    ?>          
                </select>          
            </li>        
            <!-- row 4 -->
            <li class="left">
                <span class="text">Tỉnh / TP:</span>
                <span class="star">*</span>
            </li>
            <li class="right">
                <select name="cbo_ADV_City" id="cbo_ADV_City" class="ADV_City">
                    <option class="ADV_City_item" value="">-- Chọn Tỉnh/TP --</option>
                    <?php foreach ($aCity as $key => $item): ?>
                        <option class="ADV_City_item" value="<?php echo $item->city_id; ?>" <?php if (isset($city_id) && ($city_id == $item->city_id)) echo "selected='selected'" ?>><?php echo $item->city_name; ?></option>
                        <?php
                        $i++;
                    endforeach;
                    ?>
                </select>        
            </li>        
            <!-- row 5 -->
            <li class="left">
                <span class="text">Tên liên hệ:</span>
                <span class="star">*</span>
            </li>
            <li class="right"><input type="text" id="txt_user_full_name" name="txt_user_full_name" class="txt_text2" value="<?php if (isset($user_full_name)) echo $user_full_name; ?>" maxlength="100"></li>        
            <!-- row 6 -->
            <li class="left">
                <span class="text">Điện thoại:</span>
                <span class="star">*</span>
            </li>
            <li class="right"><input type="text" id="txt_user_tel" name="txt_user_tel" class="txt_text2" value="<?php if (isset($user_tel)) echo $user_tel; ?>" maxlength="100"></li>              
    </form>        
    <!-- row 6 -->
    <li class="left">
        <span class="text">Hình minh họa:</span>
    </li>
    <li class="right">
        <form id="upload" method="post" action="<?php echo $base_url; ?>rao-vat/upload" enctype="multipart/form-data">
            <div id="drop">
                Kéo & thả hình tại đây

                <br/><a>Chọn hình ảnh</a>
                <input type="file" name="upl" multiple />
            </div>

            <ul>
                <!-- The file uploads will be shown here -->
            </ul>
        </form> 
    </li>              

    <!-- row 7 -->
    <li class="left">
        <span class="text">Nhập mã kiểm tra:</span>
        <span class="star">*</span>
    </li>
    <li class="right"><input type="text" id="txt_capchar" name="txt_capchar" class="txt_text2" maxlength="6"></li>                
    <!-- row 8 -->
    <li class="left"></li>
    <li class="right">
        <?php echo $captchar_img; ?>
    </li>     
    <!-- row 9 -->
    <li class="left"></li>
    <li class="right">
        <br>
        <input type="hidden" id="hidImgList" name="hidImgList" form="frmAdv">
        <input type="submit" value="Đăng tin" id="txt_ADV_Post" name="txt_ADV_Post" class="ADV_Post" form="frmAdv">
        <input type="reset" value="Làm lại" id="txt_ADV_Post" name="txt_ADV_Post" class="ADV_Post" form="frmAdv"> 
    </li>                
</ul>
<div class="clearfix"></div>
<div class="adv-note">Phần có dấu * là thông tin bắt buộc</div>
</div>  
<br>